-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve two spec oddities regarding new features. #723
Conversation
BOLT 4 explicitly indicates var_onion_optin may appear in a BOLT 11 invoice, however, BOLT 9 only indicates it is available in init and node_announcement contextx. Resolve this conflict in favor of BOLT 4 as there doesn't seem to be much reason to *not* allow it in BOLT 11 invoices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if var_onion_optin is set on a node_announcement (its not allowed on a channel_announcement), then trying to route through that node using the pre-tlv formt is somewhat nonsensical, and should be forbidden.
In the long term I agree (once we feel we're ready to deprecate the legacy format), but in order to make the upgrade smoother I think it's better to allow the legacy format even if you support the TLV one.
Especially as a routing node, you want to relay as many payments as possible, so you have an incentive to support both formats for maximum compatibility (until all senders support TLV).
Sorry the opener wasn’t clear. The text only applies if nodes set var_onion_optin to required, it makes no recommendation as to when a node should do that.
Note that “connect to” a node has nothing to do with routing a payment to. You, in fact, usually route payments to nodes you aren’t connected to!
… On Dec 30, 2019, at 07:54, Bastien Teinturier ***@***.***> wrote:
@t-bast commented on this pull request.
if var_onion_optin is set on a node_announcement (its not allowed on a channel_announcement), then trying to route through that node using the pre-tlv formt is somewhat nonsensical, and should be forbidden.
In the long term I agree (once we feel we're ready to deprecate the legacy format), but in order to make the upgrade smoother I think it's better to allow the legacy format even if you support the TLV one.
Especially as a routing node, you want to relay as many payments as possible, so you have an incentive to support both formats for maximum compatibility (until all senders support TLV).
In 07-routing-gossip.md:
> @@ -323,6 +323,9 @@ any future fields appended to the end):
- MUST NOT process the message further.
- if `features` field contains _unknown even bits_:
- SHOULD NOT connect to the node.
+ - Unless paying a [BOLT #11](11-payment-encoding.md) invoice which does not
I don't get why you're adding those two points.
Since the first bullet point states that you shouldn't be connected in the first place, you won't ever route to that node.
If you connect anyway (because line 325 says SHOULD NOT and not MUST NOT), you're accepting the risk of some undefined behavior, and I don't see why you wouldn't route messages through/to that node.
Can you clarify with some examples?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
IMHO it makes no sense to require
Got it, we didn't understand "route to" the same way then (depending on the context, it may mean different things so we should clarify that!). Does that make sense or am I missing something? |
a) This makes no judgement about requiring var_onion_optin or not. There's a bit for supports, and a bit for required, this just clarifies what those bits, in general mean, lets not debate what bits nodes should be setting. b) More importantly, however, this change clarifies what required unknown bits mean today - when we add better_variable_length_onion or other_amp or point_based_relay, we need to know how to interpret the unknown bits as now-"legacy" nodes. |
Then back to the PR content: we should set You didn't answer my feedback/comments on the proposed Bolt 7 changes. It feels out of place in Bolt 7 (which is supposed to describe how you receive and relay gossip messages and graph data) and the wording is confusing, "routing messages" seems to indicate we can decide through which nodes our gossip goes through whereas in reality it only applies to payments. |
We can move it to BOLT 4 if you like, but then we should probably move the whole "unknown features" clause there as well. Mostly, it doesn't matter much where it goes, it just needs to go somewhere. BOLT 4 isn't obviously correct here to me, nor is BOLT 7. In general, it sounds like, however, you agree with both changes, just maybe not where in the doc they go, correct? As for fixing the BOLT 4/9 conflict, I don't care who takes that commit. If Connor wants to take it in 719, great, if not, it can go in here! |
Yes, I think these changes make sense, it's just that I found the wording and location confusing (but maybe that's just me). For the proposed changes, I think https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md#packet-construction is a good location: that's where we explain the multi-hop routing and packet construction, so I believe it would fit well. I agree that maybe we should move the "SHOULD NOT connect to the node." feature requirement. Since it's a requirement on whether to init a connection to that node or not, maybe a better place would be here: https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#the-init-message? Maybe @rustyrussell also has something to suggest for that? |
If you find it confusing, you have a proposed alternate wording?
I think an argument could be made for BOLT 7 as well - the requirement applies to you once you’ve received the message. Happy to kick it to a meeting, but we also generally probably shouldn’t have too high a bar for small tweaks if folks agree they are “obvious” changes IMO.
… On Dec 31, 2019, at 03:28, Bastien Teinturier ***@***.***> wrote:
Yes, I think these changes make sense, it's just that I found the wording and location confusing (but maybe that's just me).
Bolt 7 has been used a bit too much as the place where everything goes when we don't really know where to put it.
For the proposed changes, I think https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md#packet-construction is a good location: that's where we explain the multi-hop routing and packet construction, so I believe it would fit well.
I agree that maybe we should move the "SHOULD NOT connect to the node." feature requirement. Since it's a requirement on whether to init a connection to that node or not, maybe a better place would be here: https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#the-init-message?
Maybe @rustyrussell also has something to suggest for that?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I'd change it to something like:
I'm also wondering if it really should be a "MUST NOT". I think SHOULD NOT is enough. Sorry if you feel I'm nitpicking, I promise the goal isn't to be annoying :) |
I tweaked the wording to be closer to your proposed, is that a bit better? As for MUST NOT/SHOULD NOT - I think in your described case, MUST NOT still applies fine - if you checked what those features mean, its no longer an "unknown" feature! In general, unless there's a good reason for it, we should prefer MUST NOT over SHOULD NOT - Postel's law has been pretty generally thrown out as bad advice when attempting to build robust systems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tweaked the wording to be closer to your proposed, is that a bit better?
Thanks, I think that's easier to understand.
As for MUST NOT/SHOULD NOT - I think in your described case, MUST NOT still applies fine - if you checked what those features mean, its no longer an "unknown" feature!
Good point :)
This appears to have been an oversight in the flat features spec, and is somewhat implicitly relied on for several new feature bits - if var_onion_optin is set on a node_announcement (its not allowed on a channel_announcement), then trying to route through that node using the pre-tlv formt is somewhat nonsensical, and should be forbidden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5abee4d
ACK 5abee4d |
Ping @cfromknecht :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, LGTM! 👏
Clients should be looking at the feature bits flags in the channel ann and channel updates instead of solely relying on node announcements. Consider the scenario in the future where a new channel type is added (or a modification on an existing type like anchor outputs). A node wishes to signal that it'll only consider new incoming channel requests that use this new channel type. In order the achieve this, they set the feature bit as required in the node announcement. This preference has no bearing on if a payment should be routed through this node (in this simplified scenario) as it expresses channel acceptance preference. |
channel updates don't have feature bits
I don't see where this says to only rely on node_announcements? There is already text there to say you cannot route through a node based on their channel_announcement features.
Right - this is somewhat confused in the current doc. Probably makes more sense to continue this discussion at #726, but var_onion_optin is a node_feature, which makes no sense in your interpretation of what node_features are for. |
It may not say it explicitly, but the guidelines here can result in degraded routing for a client which blindly adheres to them.
My example wasn't meant to be exhaustive. Instead, it shows a plausible and upcoming instance where a required feature bit on a node announcement doesn't restrict the set of HTLCs that can be routed through it. The TLV onion bit is a node level feature as onion payload are largely independent of channels, it's the node that needs to understand the payload. |
> On Jan 10, 2020, at 17:18, Olaoluwa Osuntokun ***@***.***> wrote:
I don't see where this says to only rely on node_announcements? There is already text there to say you cannot route through a node based on their channel_announcement features.
It may not say it explicitly, but the guidelines here can result in degraded routing for a client which blindly adheres to them.
I think you’re confusing issues here - there are two possible uses that node features could have - routing or connecting. The current spec assigns them both meanings, which is the point of the discussion at #726. In the mean time, please don’t violate the spec just because you feel like probing node behavior.
… but var_onion_optin is a node_feature, which makes no sense in your interpretation of what node_features are for.
My example wasn't meant to be exhaustive. Instead, it shows a plausible and upcoming instance where a required feature bit on a node announcement doesn't restrict the set of HTLCs that can be routed through it. The TLV onion bit is a node level feature as onion payload are largely independent of channels, it's the node that needs to understand the payload.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
BOLT 4 explicitly indicates var_onion_optin may appear in a BOLT 11 invoice, however, BOLT 9 only indicates it is available in init and node_announcement contextx. Resolve this conflict in favor of BOLT 4 as there doesn't seem to be much reason to not allow it in BOLT 11 invoices.
Do not allow routing to a node with unkown feature bits set. This appears to have been an oversight in the flat features spec, and is somewhat implicitly relied on for several new feature bits - if var_onion_optin is set on a node_announcement (its not allowed on a channel_announcement), then trying to route through that node using the pre-tlv formt is somewhat nonsensical, and should be forbidden.